<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel=StyleSheet HREF="../stylesheet/stylesheet.css" TYPE="text/css" MEDIA=screen>
<title>Shop Management System</title>
<?php include('menu.php'); ?>
</head>
<body>
<?php
include("../connect/connect.php");

	$Query = "SELECT firstname,lastname,user_group_id FROM user WHERE user_group_id <= 1 ORDER BY user_group_id DESC";
	$objQuery = mysql_query($Query) or die ("Error Query [".$Query."]");
?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
    <div class="heading">
      <h1>ข้อมูลพนักงาน</h1>
	</div>
  <div class="content">
<table class="list">
        <thead>
          <tr>
            <td width="132" style="text-align: center;"><span class="center">ลำดับ</span></td>
              <td width="492" class="center">ชื่อ - นามสกุล </td>
              <td width="384" class="center">ตำแหน่ง</td>
          </tr>
        </thead>
        <tbody>
  <?php
	$strnum=0;
	while($row = mysql_fetch_array($objQuery))
		{
		$strnum++;
?>
          <tr>
            <td style="text-align: center;"><?php echo $strnum;?></td>
              <td class="center"><?php echo $row["firstname"]."&nbsp;&nbsp;&nbsp;".$row["lastname"];?></td>
              <td class="center"><?php if($row["user_group_id"]=='0') {echo "พนักงาน";} if($row["user_group_id"]=='1') {echo "ผู้จัดการ";}?></td>
          </tr>
  <?php
		}
?>
        </tbody>
      </table>
  </div>
</div>

</body>
</html>
